﻿@model List<MatchPlayListEntry>

@{
    ViewBag.Title = "Matchplay";
}

<div class="page-header">
    <h1><span class="glyphicon glyphicon-tower"></span> Matchplay</h1>
</div>

<ul class="pagination">
    @foreach (Season s in ViewBag.Seasonlist)
    {
        <li>@Html.ActionLink(s.Name, "Season", new { id = s.Id })</li>
    }
</ul>

<div class="row">
    <div class="col-md-6">
        <h2>Stilling @ViewBag.SeasonName</h2>
        <hr />
        <table class="table table-hover">
            <thead>
                <tr>
                    <th class="text-center">
                        #
                    </th>
                    <th>
                        Spiller
                    </th>
                    <th>Point</th>
                    <th>Matches</th>
                    <th>
                        Vundet
                    </th>
                    <th>
                        Uafgjort
                    </th>
                    <th>
                        Tabt
                    </th>
                </tr>
            </thead>

            <tbody>
                @foreach (var item in Model)
                {
                <tr>
                    <td class="text-center">
                        @Html.DisplayFor(modelItem => item.TiedPositionIndicator)@Html.DisplayFor(modelItem => item.Position)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.Player.DisplayName)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.CalculatedPoints)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.MatchesPlayed)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.MatchesWon)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.MatchesSquared)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.MatchesLost)
                    </td>
                </tr>
                }
            </tbody>
        </table>
    </div>
    <div class="col-md-6">
        <h2>Afviklede matcher</h2>
        <hr />
        @{ Html.RenderAction("AllMatchesForSeason", "Matchplay", new { SeasonId = ViewBag.SeasonId }); }
    </div>
</div>
